#include "sygraph.h"
namespace sy
{
	namespace graph
	{
		Rect::Rect() :x1(0.0f), y1(0.0f), x2(0.0f), y2(0.0f)
		{

		}

		Rect::Rect(vector2 _lu, vector2 _rb) : lu(_lu), rb(_rb)
		{
		}

		Rect::Rect(float _x1, float _y1, float _x2, float _y2) : x1(_x1), y1(_y1), x2(_x2), y2(_y2)
		{
		}

		Rect::Rect(const Rect& rec)
		{
			if (&rec != this)
			{
				this->lu = rec.lu;
				this->rb = rec.rb;
			}
		}
		Rect& Rect::operator=(const Rect& rec)
		{
			if (this != &rec)
			{
				this->lu = rec.lu;
				this->rb = rec.rb;
			}
			return *this;
		}

		Point::Point():x(0.0f), y(0.0f)
		{

		}

		Point::Point(const vector2& _vec) : vec(_vec)
		{
		}

		Point::Point(float _x, float _y):x(_x), y(_y)
		{
		}

		Point::Point(const Point& p)
		{
			if (this != &p)
			{
				this->vec = p.vec;
			}
		}

		Point& Point::operator=(const Point& p)
		{
			if (this != &p)
			{
				this->vec = p.vec;
			}
			return *this;
		}

		Point& Point::operator=(const vector2& vec)
		{
			this->vec = vec;
			return *this;
		}

		bool Point::Inside(const Rect& rect)
		{
			if (this->x <= rect.r && this->x >= rect.l && this->y >= rect.b && this->y <= rect.u)
				return true;
			return false;
		}

	}
}